Efficient triangular shaped meshes

ABSTRACT

The present invention renders a triangular mesh for employment in graphical displays. The triangular mesh comprises triangle-shaped graphics primitives. The triangle-shaped graphics primitives represent a subdivided triangular shape. Each triangle-shaped graphics primitive shares defined vertices with adjoining triangle-shaped graphics primitives. These shared vertices are transmitted and employed for the rendering of the triangle-shaped graphics primitives.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a division of, and claims the benefit of the filingdate of, co-pending U.S. patent application Ser. No. 10/242,523 entitledEfficient Triangular Shaped Meshes, filed Sep. 12, 2002.

TECHNICAL FIELD

This invention relates generally to graphics, and more particularly, tothe rendering triangular shaped meshes from triangle shaped graphicsprimitives.

BACKGROUND

In computer graphics, various graphical shapes are created and renderedby the employment of basic graphical building blocks, known as graphicsprimitives. One widely-used graphics primitive is a triangle graphicprimitive. Triangle primitives can be aggregated into triangle strips.The triangle strips comprise a row of triangle primitives aggregatedtogether in alternating apex-orientations, both upwards and downwards.Triangle strips are typically a flexible unit of computer graphicmanipulation because they can represent a single triangle (that is, a“three vertex” triangle strip), a single quadrilateral (that is, a “fourvertex” triangle strip), or a rectangular lattice comprising a pluralityof vertically-aggregated triangle strips. A rectangular lattice isgenerally defined as a rectangular two-dimensional aggregation of aplurality of rows of triangle strips, wherein internal vertices arerepeated during transmission.

Employing triangle strips can be reasonably data efficient for thetransmittal and rendering of long aggregations of triangle primitives tocreate a single row. This is because, in a triangle strip, the number ofvertices per graphical triangle shaped primitive approaches the ratio ofone to one, thereby necessitating the transmission of a minimum numberof vertices to render (that is, to graphically recreate and display) atriangular strip.

However, the employment of triangle strips to render a rectangularlattice entails inefficiencies. Generally, the inefficiencies arebecause each row of vertices internal to the rectangular lattice has tobe repeated. For instance, a rectangular lattice, comprising 24equilateral triangles, actually requires 30 strip vertices to berendered (eight triangles per row by three rows).

Subdivision surfaces, that is, the graphical technique of segmenting agiven shape into constituent sub-shapes, are becoming ever more widelyemployed in graphics. However, subdivision can be especially inefficientwith respect to data transfer overhead, particularly when triangle stripdata is generated. This is typically because, similar to a rectangularlattice, internal row vertices are repeated. In the limit (that is, asthe subdivision level approaches infinity), the efficiency approaches50%.

A second approach to graphical design is to directly support basicgraphical primitives so that internal row vertices need not be repeated.This creates a mesh, such as a rectangular mesh. A rectangular mesh isgenerally defined as a rectangular aggregation of graphics primitives,wherein the rectangular aggregation of graphics primitives did not occurdue to the two-dimensional aggregation of a plurality of trianglestrips.

In one known approach of creating a rectangular mesh, the renderercaches both the previous row of vertices of a given row of aggregatedtriangle-shaped or quadrilateral-shaped primitives. Then, instead ofreceiving both rows of vertices for the next row of aggregatedtriangle-shaped or quadrilateral-shaped primitives, the renderer onlyreceives the top row of vertices for the next row of aggregatedtriangle-shaped or quadrilateral-shaped primitives, thereby reducing thetransmitted information needed to draw the rectangular mesh andincreasing efficiency. Rendering a rectangular mesh can be moreefficient than rendering a rectangular lattice created by theaggregation of primitive strips.

However, processor performance has outpaced memory and bus performance,while at he same time, the employment of subdivision surfaces hasincreased the demand for higher throughput. Therefore, there is a needfor employing graphics primitives for rendering a subdivided trianglethat overcomes the shortcomings of existing approaches.

SUMMARY

The present invention employs video information associated with atriangular mesh. The present invention derives a plurality of adjacenttriangle-shaped primitives of a first row. Each triangle-shapedprimitive is defined as having both at least one lower vertex and atleast one upper vertex. At least one lower vertex and at least one uppervertex of a selected triangular primitive of the first row are cached.At least one lower vertex of the selected triangle primitive isoverwritten with at least one upper vertex of the selected triangularprimitive. One or more new upper vertexes of a selected triangleprimitive of the next row are cached, thereby generating a triangularmesh.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of the present invention, and theadvantages thereof, reference is now made to the following DetailedDescription, taken in conjunction with the accompanying drawings, inwhich:

FIG. 1A illustrates a 3-dimensional shape having a triangular mesh,wherein the triangular mesh is further subdivided into triangulargraphics primitives;

FIG. 1B illustrates a more-detailed triangular mesh, wherein thetriangular mesh has been further subdivided into triangular graphicsprimitives;

FIG. 2 illustrates a method for employing and rendering displayinformation associated with a triangular mesh; and

FIG. 3 illustrates a “C” pseudo-code subroutine, drawTriangualarMesh( ),employable for the rendering of a triangular mesh by a video device.

DETAILED DESCRIPTION

In the following discussion, numerous specific details are set forth toprovide a thorough understanding of the present invention. However,those skilled in the art will appreciate that the present invention maybe practiced without such specific details. In other instances,well-known elements have been illustrated in schematic or block diagramform in order not to obscure the present invention in unnecessarydetail. Additionally, for the most part, details concerning networkcommunications, electro-magnetic signaling techniques, and the like,have been omitted inasmuch as such details are not considered necessaryto obtain a complete understanding of the present invention, and areconsidered to be within the understanding of persons of ordinary skillin the relevant art.

It is further noted that, unless indicated otherwise, all functionsdescribed herein may be performed in either hardware or software, orsome combination thereof. In a preferred embodiment, however, thefunctions are performed by a processor, such as a computer or anelectronic data processor, in accordance with code, such as computerprogram code, software, and/or integrated circuits that are coded toperform such functions, unless indicated otherwise. In a furtherpreferred embodiment, the computer program is embodied upon or within acomputer program product, such as a floppy disk or compact disk, orother storage medium.

Referring to FIG. 1A, illustrated is an exemplary 3-dimensional shape,an octahedron 100, subdivided into a triangular shape 105, wherein thetriangular shape is one triangle base of the octahedron 100. Theoctahedron 100 is further subdivided into triangular meshes 150. Thetriangular mesh 150 is subdivided into triangle primitives 155.Therefore, the triangular shape 105 also comprises a triangular mesh150. Each triangle primitive 155 has its own unique set of definedvertices, although a vertex element of a unique set of defined verticescan be shared with another triangle primitive 155.

Generally, the subdivisions of triangular shape 105 occur to moreeffectively enable the creation or generation (that is, the mathematicalcalculation) and more accurate rendition (that is, the final display) ofa given shape, such as a triangular shape. One subdivision unit ofutility is the triangle primitive. In other words, a given shape, suchas triangular shape 105, is ultimately subdivided into constituentelements, such as triangle primitives 155. The ultimate subdivision oftriangular shape 105 into triangle primitives 155 is a technique ofgreat utility in graphics systems.

In FIG. 1A, the triangle primitives 155 of triangular shape 105 aredefined in relation to one another to comprise the triangular mesh 150.Generally, in FIG. 1A, each triangular mesh 150 is a result of both asubdivision of the triangular shape 105 and the further subdivision ofthis subdivision into triangle primitives 155. Therefore, the triangularshape 105 is also a triangular mesh, as it comprises triangle primitives155 and triangular meshes 150.

The triangular shape 105, with its constituent unique vertices of thevarious triangle primitives 155, is typically generated in a microchipor some other graphics calculation device. Any unique vertices are thentransmitted to a video display device for rendering. Unique vertices ofthe triangle primitives 155 are generally defined as vertices derivedfor the purpose of rendering graphical primitives, but these verticesare not duplicated during transmission. The unique vertices are receivedby the video display device and employed in the rendering of thetriangular mesh 150.

In one embodiment, rendering the triangular mesh 150 on the displaydevice is performed through the transmission of the bottom row ofvertices, then the transmission of the upper row of vertices of atriangular strip. Triangle primitives are not rendered until the topvertices are received. In another embodiment, the rendering of thetriangular mesh 150 is generally accomplished through transmitting boththe top and bottom vertices of the first row of triangle graphicsprimitives 155. These transmittances can occur from the graphicscalculator or processor and then storing the vertices in a local storagecenter, such as a vertex cache of the video device. The video devicerenders the first row of adjacent triangle primitives 155. The videobuffer then overwrites the cached unique lower vertices of the first rowof graphical primitives 155 with the values of the cached unique uppervertices of the first row of graphical primitives 155. This creates anew unique set of lower vertices employable for rendering the next rowof graphical primitives 155. Employing overwriting avoids the necessityof a substantial duplication of transmission of the vertices in commonbetween rows between the graphics calculation device and the displaydevice.

The graphics calculation device then sends the top unique vertices ofthe next row of triangle primitives 155 of the triangular mesh 150 tothe video device. The video display device renders a new row. Theprocess continues until the apex of the triangular shape is reached,whereupon this last unique vertex is sent for the apex triangleprimitive 155. Calculations are made to allow for the decreasing numberof unique upper vertices per higher row.

Therefore, the rendered triangular shape 105 comprises triangular meshes150. Typically, the rendered shape does not comprise a triangularlattice. A triangular lattice is generally defined as a triangulartwo-dimensional aggregation of a plurality of rows of triangular strips,wherein internal vertices have been repeated during transmission. Thetriangular mesh 150 was created and rendered through the transmissionand employment of unique vertices, not through the aggregation oftriangle strips, thereby substantially reducing data transmissioninefficiencies.

FIG. 1B illustrates the triangular mesh 150, wherein the triangular mesh150 is further subdivided and comprises triangle primitives 155. In theillustrated embodiment, the triangular mesh 150 comprises 16 triangleprimitives. The triangle graphics primitives are illustrated as numberedfrom 1 to 16, and are placed in four rows. The first row comprisestriangle primitives 1 through 7, inclusive. The second row comprisestriangle primitives 8 through 12, inclusive. The third row comprisestriangle primitives 13 through 15, inclusive. Finally, the fourth rowcomprises triangle primitive 16. Although illustrated as comprising fourrows, those skilled in the art will understand that, in a furtherembodiment, the triangular mesh 150 can comprise more than four rows oftriangle primitives 155.

Within each row, the base of a first triangle primitive 155 and the lasttriangle primitive 155 within the selected row is oriented to the bottomof the triangular mesh 150. The remaining triangle primitives alternatein orientation. In other words, contiguous to the triangle primitive“1”, the apex of which is oriented to the top of the triangular mesh150, there is a triangle primitive “2”, the apex of which is oriented tothe base of the triangular mesh 150, and so on. This alternationcontinues until the last triangle primitive is reached per row, whereinthe apex of the last triangle primitive is oriented to the apex of thetriangular mesh 150.

The triangle primitives “1” through “7” of row 1 have verticesassociated with them. Triangle primitive “1” of row 1 is defined by thebottom vertices “1” and “2” and the top vertex “6.” Triangle primitive“2” of row 1 is defined by the bottom vertex “2” and the top vertices“6” and “7”. Triangle primitive “3” of row 1 is defined by the bottomvertices “2” and “3” and the top vertex “7”, and so on.

In the triangular mesh 150, the top vertices of the triangle graphicsprimitives of row 1 are defined as the bottom vertices of the trianglevertices of row 2. For instance, vertex “6”, the top vertex of triangleprimitive “1” of row 1, and vertex “7”, the top vertex of triangleprimitive “2” of row 1, are defined as the bottom vertices of triangleprimitive “8” in row 2. Vertex “7”, the top vertex of triangle primitive“3” of row 1, and vertex “8”, the top vertex of triangle primitive “5”of row 1, are defined as the bottom vertices of triangle primitive “10”in row 2. Vertex “7”, the top vertex of triangle primitive “3” of row 1,is also defined as the bottom vertex of triangle primitive “9” in row 2.The redefining of the top vertices of a prior row as the bottom verticesof a consecutive row is continued until defining the upper vertex of thetriangle primitive of the final row. In the illustrated embodiment, thisis triangle primitive “16”.

Within the triangular mesh 150, the lower vertices of each triangleprimitive of a higher-order row (for example, row 3) are defined as afunction of the upper vertices of the triangle primitives of alower-order row (for example, row 2). Therefore, the triangular mesh 150can be rendered with the transmission of only unique vertices.Employment of only unique vertices to construct a triangular meshrequires a transmission of a lesser number of vertices than is requiredto construct a triangular lattice, of the same shape and size, from thevertical aggregation of a plurality of triangle strips.

Rendering a triangular lattice, constructed of a plurality of trianglestrips, requires non-unique vertices. This is because each row of theaggregated triangle strips, which creates the triangular lattice, isdefined independently from a consecutive triangle strip in thetriangular lattice, therefore requiring more vertices to beindependently defined than in a triangular mesh.

A comparison of efficiencies between triangular meshes 150 and atriangular lattice is demonstrated in the following table. The “level”is generally defined as the number of bisections performed, that islevel “0” is a unitary triangle, level “1” is a bisected triangle, level“2” is a bisected triangle wherein each bisection has been furtherbisected, and so on. The “alternate level” is generally defined as atriangle that has been subdivided into a given number of equalsubdivisions. In other words, an alternate level of 0 represents aunitary triangle, an alternate level of 1 represents a subdividedbisected triangle, an alternate level of 2 represents a subdividedtrisected triangle, and so on. In other words, alternate levels comprisesubdividing a triangle to the nth division (“n-sectioning), such as abisection, a trisection, and so on.

“Unique mesh vertices” are generally defined as the number of verticesrequired to construct a subdivided triangular mesh, “triangle stripvertices” are generally defined as the number of vertices required toconstruct a subdivided triangle lattice from triangle strips.“Efficiency” is a comparison of the efficiency of employing trianglestrip vertices for constructing a triangular shape to employing theunique vertices of a triangular mesh to create a triangular shape.Alternate Unique Triangle Level Level Mesh Vert. Strip Vert. Efficiency0 0 3 3 100%  1 1 6 8 67% 2 3 15 24 62% 3 7 45 80 56% 4 15 153 288 53% n2^(n−1) 1 + 2⁽²*^(n−1)) + 4^(n) + Asymptotically 3*2^((n−1)) 2^((n+1))approaches 50%

Therefore, it is typically more efficient to render a triangular shapefrom unique vertices, thereby creating a triangular mesh, than fromstrip vertices, thereby creating a triangular lattice.

Turning now to FIG. 2, illustrated is a method 200 for creating andrendering the triangular mesh 150. Generally, the method 200 calculatesthe vertices of the graphics primitives that represent subdivisions of atriangular shape 105. In method 200, the subdivisions comprise triangleprimitives. Then, the method 200 transmits unique vertices to the videodevice. The video device renders the triangle graphics primitives as thetriangular mesh 150.

In step 210, the graphics processor calculates and derives the uniquevertex coordinates for the subdivided triangular area 105. Thetriangular area 105 is then subdivided into triangle graphicsprimitives, creating a triangular mesh 150. In one embodiment, thesubdividing comprises a bisection. As will be understood by those ofskill in the art, other subdivision sub-secting schemes are within thescope of the present invention.

In step 220, the graphics processor transmits the plurality of uniquevertices for a selected row to the video display. If the unique verticesto be transmitted contain the lower vertices of the bottom row, both theupper and lower vertices of the first row are transmitted, wherein firstall of the lower vertices are transmitted, then all of the uppervertices are transmitted. If the vertices to be transmitted do notcontain the lower vertices of the bottom row, only the upper verticesare transmitted for the row.

In step 230, the video device caches the values of the vertices of thetriangle primitives as derived in step 210 and transmitted in step 220,wherein first all of the lower vertices are transmitted, then all of theupper vertices are transmitted. If the vertices to be transmittedcontain the lower vertices of the bottom row, both the upper and lowervertices are cached in the step 230. If the received vertices do notcontain the lower vertices of the bottom row, only the upper verticesfor the row are transmitted in step 220 and received and cached in step230.

In step 240, the video device renders the triangle primitive orprimitives 155. In one embodiment, the rendering process is performed bythe video device further comprises the steps of lighting, shading, andtexture/displacement mapping the triangle primitive 155.

In step 250, if the rendering graphical object is finished, that is, ifthe apex vertex of the apex triangle primitive has been received, thenstop step 275 is executed. In other words, the triangular mesh 150 hasbeen rendered. If the apex vertex of the apex triangle primitive has notyet been received, step 260 is executed.

In step 260, the video display overwrites the values of the lowervertices of the newly transmitted row with the values of the highervertices of the previously transmitted row. Therefore, the highervertices of the previous row become the lower vertices of the next row.In step 270, the next row to be transmitted is incremented (for example,from row 2 to row 3). In step 220, the graphics processor transmits thehigher vertices of this new row, and so on.

Turning briefly to FIG. 3, disclosed is a “C” pseudo-code subroutinedrawTriangularMesh( ) for rendering the triangular mesh 150 by the videodevice. Generally, the MAX_MESH_WIDTH variable equals the maximum numberof vertices in the bottom row of the subdivided triangle, such as thetriangular mesh 150. In FIG. 3, MAX_MESH_WIDTH is the maximum allowable“width” parameter.

Generally, renderTriangle( ) is called to render 0, 1, or 2 triangleprimitives for each vertex received. Zero triangle primitives arerendered for the first (“width”) row of vertices. One triangle primitiveis rendered for the first vertex of each row. Two triangle primitivesare rendered for each subsequent vertex. The subroutine renderTriangle() also renders the triangle primitive in a higher row. This continuesuntil the very highest row, which comprises only a single triangleprimitive. Those skilled in the art understand the use and applicationsof “C” pseudo-codes, and therefore the C pseudo-code will not bedescribed in more detail.

It is understood that the present invention can take many forms andembodiments. Accordingly, several variations may be made in theforegoing without departing from the spirit or the scope of theinvention.

Having thus described the present invention by reference to certain ofits preferred embodiments, it is noted that the embodiments disclosedare illustrative rather than limiting in nature and that a wide range ofvariations, modifications, changes, and substitutions are contemplatedin the foregoing disclosure and, in some instances, some features of thepresent invention may be employed without a corresponding use of theother features. Many such variations and modifications may be consideredobvious and desirable by those skilled in the art based upon a review ofthe foregoing description of preferred embodiments. Accordingly, it isappropriate that the appended claims be construed broadly and in amanner consistent with the scope of the invention.

1. An apparatus for transmitting and rendering a triangular meshcomprising a plurality of graphics triangle primitives, the graphicstriangle primitives having at least one lower and upper vertex,comprising: a graphics processor, wherein the graphics processor isemployable to derive a plurality of adjacent graphics triangleprimitives; and a display device employable to cache both the at leastone lower vertex and at least one upper vertex of each triangleprimitive, wherein the display device is further employable to overwriteat least one lower vertex of each graphics triangle primitive with atleast one higher vertex of each triangle primitive, the display devicestill further employable to cache at least one new upper vertex of atriangle primitive of the next higher row.
 2. The apparatus of claim 1,wherein the graphics processor is employable to subdivide a triangularshape from triangle primitives, thereby creating a triangular mesh. 3.The apparatus of claim 2, wherein the step of subdividing comprisescreating a substantially equalized bisection.
 4. The apparatus of claim2, wherein the step of subdividing comprises creating a substantiallyequalized n-section.
 5. A method for employing protocol for thetransmission and rendering of a triangular mesh, comprising: a firstrendering of one triangle primitive upon receipt of an upper vertex of arow, wherein the vertex of the row is not the last vertex of the row; asecond rendering of two triangle primitives upon receipt of the lastupper vertex of a row; and decrementing a mesh width after a row ofvertices is received.
 6. The method of claim 5, wherein the step offirst rendering employs triangle primitives extendable to create atriangular mesh.
 7. The method of claim 5, wherein a step of asubdividing decomposes a shape to be transmitted and rendered intosubdivisions.
 8. The method of claim 7, wherein the step of subdividingcomprises creating a substantially equalized bisection.
 9. The method ofclaim 7, wherein the subdividing comprises creating a substantiallyequalized n-section.